cmake_minimum_required(VERSION 2.8.8)

set(PROJECT_NAME osgCMakeExampleModern)

project(${PROJECT_NAME})
set(Fontconfig_DIR ${CMAKE_SOURCE_DIR})
find_package(Fontconfig REQUIRED)
find_package (OpenSceneGraph REQUIRED COMPONENTS osgUtil osgDB osgText osgGA osgFX osgSim osgViewer CONFIG)
find_package(Qt5 COMPONENTS Core Widgets Gui)

# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)

set(SOURCES
    OsgQtView.cpp
    OsgQtView.h
)


add_executable(${PROJECT_NAME} ${SOURCES})

target_link_libraries(${PROJECT_NAME} 
    Qt5::Gui 
    Qt5::Core 
    Qt5::Widgets 
    osg3::osg 
    osg3::osgUtil 
    osg3::osgDB 
    osg3::osgText 
    osg3::osgGA 
    osg3::osgFX 
    osg3::osgSim 
    osg3::osgViewer
)